package com.yunhe.mybatis.web.mett;

import com.yunhe.mybatis.entity.Meet;
import com.yunhe.mybatis.entity.User;
import com.yunhe.mybatis.service.MeetService;
import com.yunhe.mybatis.service.impl.MeetServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/meet/m/update")
public class Update  extends HttpServlet{
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        Integer meetId = Integer.valueOf(req.getParameter("meetId"));
        MeetService meetService = new MeetServiceImpl();
        Meet meet = meetService.find(meetId);
        req.setAttribute("meetId",meet);
        req.getRequestDispatcher("/WEB-INF/meet/update.jsp").forward(req,resp);
    }
}
